const path = require('path');                 //把配置文件引进webpack.config.js，path内置的模块，用来设置路径。
module.exports = {
    devServer: {
        contentBase: 'dist'
    },

    entry: './src/js/entry.js',
    output: {
        filename: 'index.js',
        path: path.resolve(__dirname, 'dist/js')
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                use: [
                    'style-loader',
                    'css-loader'
                ]
            },
            {
                test: /\.(png|jpg|gif)$/,
                use: [
                    {
                        loader: 'url-loader',
                        options: {
                            limit: 8192
                        }
                    }
                ]
            }
        ]
    }

};
